package com.zxymq.amqp.support;

import org.springframework.amqp.support.converter.DefaultJackson2JavaTypeMapper;

import java.util.HashMap;
import java.util.Map;

//简单的扩展架构常量，便于后期维护
public class ZxyJackson2JavaTypeMapper extends DefaultJackson2JavaTypeMapper {
    public final static String DEFAULT_ZXY_LIST_TYPE = "java.util.List";
    public final static String DEFAULT_ZXY_MAP_TYPE = "java.util.Map";
    public final static String DEFAULT_ZXY_STRING_TYPE = "java.lang.String";
    public final static String DEFAULT_ZXY_TYPE_ID = "zxyTypeId";
    private final Map<String, Class<?>> idClassMapping = new HashMap<String, Class<?>>();

    public void setIdClassMapping(Class<?> dstClass) {
        idClassMapping.put(this.DEFAULT_ZXY_TYPE_ID, dstClass);
        super.setIdClassMapping(idClassMapping);
    }
}
